package com.grass.p019lv.adapter;

import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.androidsa.bttsddka.R;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.base.view.CircleImageView;
import com.grass.p019lv.bean.FansBean;

/* renamed from: com.grass.lv.adapter.FansMessageAdapter */
public class FansMessageAdapter extends BaseRecyclerAdapter<FansBean, ViewHolder> {
    private String domain;

    public void setDomain(String str) {
        this.domain = str;
    }

    public void MyHolder(ViewHolder viewHolder, int i) {
        viewHolder.setData((FansBean) getDataInPosition(i));
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new ViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_fans_layout, viewGroup, false));
    }

    /* renamed from: com.grass.lv.adapter.FansMessageAdapter$ViewHolder */
    public class ViewHolder extends BaseRecyclerHolder {
        ImageView btn_follow;
        CircleImageView img_user_head;
        TextView tv_nick_name;

        public ViewHolder(View view) {
            super(view);
            this.img_user_head = (CircleImageView) view.findViewById(R.id.img_user_head);
            this.tv_nick_name = (TextView) view.findViewById(R.id.tv_nick_name);
            ImageView imageView = (ImageView) view.findViewById(R.id.btn_follow);
            this.btn_follow = imageView;
            imageView.setOnClickListener(this);
        }

        /* access modifiers changed from: package-private */
        public void setData(FansBean fansBean) {
            if (TextUtils.isEmpty(fansBean.getLogo())) {
                GlideUtils.loadPicHeadDefault(this.img_user_head);
            } else {
                GlideUtils.loadPicHead(FansMessageAdapter.this.domain + fansBean.getLogo(), this.img_user_head);
            }
            this.tv_nick_name.setText(fansBean.getNickName());
            if (fansBean.isIsAttention()) {
                this.btn_follow.setImageResource(R.drawable.ic_btn_cancel_follow);
            } else {
                this.btn_follow.setImageResource(R.drawable.ic_btn_follow);
            }
        }
    }
}
